// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import './assets/css/global.css'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'font-awesome/css/font-awesome.min.css'

import * as echarts from 'echarts'

import axios from 'axios'

import constant from '@/assets/js/constant.js'
import commonJs from '@/assets/js/common.js'

Vue.prototype.$axios = axios
axios.defaults.baseURL = '/vue2'
axios.interceptors.request.use(function (config) {
  let token = sessionStorage.getItem('token')
  if (token) {
    config.headers['token'] = token
  }
  return config
})



Vue.config.productionTip = false

Vue.use(ElementUI);

Vue.prototype.$echarts = echarts
Vue.prototype.$constant = constant
Vue.prototype.$commonJs = commonJs

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
